﻿using com.yoozoo.gta.Extension.UGUI.ScreenOrientationEx;
using UnityEditor;
using UnityEngine;

namespace com.yoozoo.gta.Extension.UGUI.Editor
{
    
    
    [CustomEditor(typeof(AdaptBase<,>), true)]
    public class AdapterBaseEditor:UnityEditor.Editor
    {
        public override void OnInspectorGUI()
        {
            if (EditorApplication.isPlaying || !EditorPrefs.GetBool("ScreenOrientManager_InspectorEditMode", false))
            {
                GUI.enabled = false;
            }
            
            base.OnInspectorGUI();
            if (EditorApplication.isPlaying || !EditorPrefs.GetBool("ScreenOrientManager_InspectorEditMode", false))
            {
                GUI.enabled = true;
            }
            
            serializedObject.Update();
            var item = target as ScreenOrientationChangeHandler;
            if(GUILayout.Button("保存"))
            {
                //给所有空的添加Adapter组件
                item.SaveConfigData();

            }
        }
    }
}